<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.cn.zpark.utils.PageInfo" %>
<%@ page import="com.cn.zpark.beans.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">s
    <title></title>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="10">
    <tr>
        <th>ID</th>
        <th>用户名字</th>
        <th>密码</th>
        <th>邮箱</th>
        <th>电话号码</th>
        <th>工资</th>
    </tr>

    <c:forEach items="${pageData.getInfo()}" var="user">
        <tr>
            <td>${user.getId()}</td>
            <td>${user.getUsername()}</td>
            <td>${user.getPassword()}</td>
            <td>${user.getEmail()}</td>
            <td>${user.getPhone()}</td>
            <td>${user.getSalary()}</td>
        </tr>
    </c:forEach>

    <tr>
        <td>总数量：${pageData.getSumNumber()}</td>
        <td>
            <a href='${pageContext.servletContext.contextPath}/page_find_user.do?pageSum=${pageData.getPageNumber()}&sum=${pageData.getSumNumber()}&pageCode=${pageData.getUpPage()}&number=${pageData.getNumber()}&pageInfo=true'>上一页</a>
        </td>
        <td>第 ${pageData.getCurrentPage() + 1}页</td>
        <td>
            <a href='${pageContext.servletContext.contextPath}/page_find_user.do?pageSum=${pageData.getPageNumber()}&sum=${pageData.getSumNumber()}&pageCode=${pageData.getNextPage()}&number=${pageData.getNumber()}&pageInfo=true'>下一页</a>
        </td>
        <td>共 ${pageData.getPageNumber()} 页</td>
        <td></td>
    </tr>

    <%--<%
        // 动态展示数据
        // 从请求域中获取分页信息绑定的数据
        PageInfo<User> pageInfo = (PageInfo<User>) request.getAttribute("pageData");

        // 循环显示查询结果数据
        for (User user : pageInfo.getInfo()) {
            out.println("<tr>");

            out.println("<td>"+user.getId()+"</td>");
            out.println("<td>"+user.getUsername()+"</td>");
            out.println("<td>"+user.getPassword()+"</td>");
            out.println("<td>"+user.getEmail()+"</td>");
            out.println("<td>"+user.getPhone()+"</td>");
            out.println("<td>"+user.getSalary()+"</td>");

            out.println("</tr>");
        }

        out.println("<tr>");

        out.println("<td>总数量："+pageInfo.getSumNumber()+"</td>");

        out.println("<td><a href='"+request.getServletContext().getContextPath()+"/page_find_user.do" +
                "?pageSum="+pageInfo.getPageNumber()+"&sum="+pageInfo.getSumNumber()+"" +
                "&pageCode="+pageInfo.getUpPage()+"&number="+pageInfo.getNumber()+"&pageInfo=true'>上一页</a></td>");

        out.println("<td>第 "+(pageInfo.getCurrentPage() + 1)+" 页</td>");

        out.println("<td><a href='"+request.getServletContext().getContextPath()+"/page_find_user.do" +
                "?pageSum="+pageInfo.getPageNumber()+"&sum="+pageInfo.getSumNumber()+"" +
                "&pageCode="+pageInfo.getNextPage()+"&number="+pageInfo.getNumber()+"&pageInfo=true'>下一页</a></td>");

        out.println("<td>共 "+pageInfo.getPageNumber()+" 页</td>");
        out.println("<td>"+pageInfo.getNextPage()+"</td>");

        out.println("</tr>");
        /*条件 ？ 结果1：结果2*/
    %>--%>

</table>
</body>
</html>

